<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        new Promise((resolve, reject) => {
            // 宏任务
            setTimeout(() => {
                resolve();
                // 宏任务创建的微任务
                console.log('settimeout......');
            }, 1000);

            //微任务
            console.log('promise......');
        }).then((value) => {
            console.log('成功');
        })
        // 微任务
        console.log('hehe........');
        // promise...... ------->  hehe........ --------> settimeout...... ------> 成功

        // async ----> new Promise()   await -------> .then()
    </script>
</body>

</html>